//通过promise来读取文件中的weixue
//先引入fs模块
const fs = require('fs')
let promise = new Promise(function (resolve, reject) {
    fs.readFile('./resource/weixue.mda', (err, data) => {
        //如果失败
        if (err) reject(err);
        //如果成功
        resolve(data)
    });

});

//调用then函数
promise.then(function(value){
    console.log(value.toString());
},function(reason){
    console.log('获取数据失败');
})
